home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / dialupip / dialupip2.0 / sys / net / if_du.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-01-14  |  3.5 KB  |  95 lines

  1. /*
  2. **  Copyright (c) 1991 Bolt Beranek and Newman, Inc.
  3. **  All rights reserved.
  4. **
  5. **  Redistribution and use in source and binary forms are permitted
  6. **  provided that: (1) source distributions retain this entire copyright
  7. **  notice and comment, and (2) distributions including binaries display
  8. **  the following acknowledgement:  ``This product includes software
  9. **  developed by Bolt Beranek and Newman, Inc. and CREN/CSNET'' in the
  10. **  documentation or other materials provided with the distribution and in
  11. **  all advertising materials mentioning features or use of this software.
  12. **  Neither the name of Bolt Beranek and Newman nor CREN/CSNET may be used
  13. **  to endorse or promote products derived from this software without
  14. **  specific prior written permission.
  15. **
  16. **  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  17. **  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  18. **  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  19. */
  20.  
  21. /*
  22. **  Request packet sent on /dev/dialup.
  23. */
  24. struct du_pkt {
  25.     struct sockaddr_in    du_sin;
  26.     struct        ip du_ip;
  27.     short        du_checkit;
  28.     char        du_ifname[4];
  29.     int            du_ifunit;
  30. };
  31.  
  32.  
  33. #define DIALMAXPENDING    5
  34.  
  35. struct du_var {
  36.     char    duv_list[DIALMAXPENDING][sizeof (struct du_pkt)];
  37.     u_short    duv_family;    /* address family            */
  38.     short    duv_size;    /* size of ring buffer            */
  39.     short    duv_index;    /* index to start of buffer        */
  40.     short    duv_wait;    /* semaphore for sleep/wakeup        */
  41. };                        
  42.  
  43. #define DIOINIT        _IOW(d, 1, short)
  44.  
  45.  
  46. /*
  47. **  Global DU statistics.  gds_ndu must be first; see if_du.c
  48. */
  49. struct globdialstats {
  50.     long    gds_ndu;    /* Number of interfacves configured    */
  51.     long    gds_ipup;    /* input packets recieved from above (TCP) */
  52.     long    gds_ipln;    /* input packets recieved from lines    */
  53.     long    gds_opln;    /* output packets sent out on lines    */
  54.     long    gds_opup;    /* output packets sent upward (TCP)    */
  55. };
  56.  
  57.  
  58. /*
  59. **  Per-interface statistics and state.
  60. */
  61. struct du_softc {
  62.     /* ds_if must be first; code in if_du.c can depend on it! */
  63.     struct ifnet ds_if;        /* network-visible interface        */
  64.     short    ds_flags;    /* see below                */
  65.     short    ds_ilen;    /* length of input-packet-so-far    */
  66.     struct tty    *ds_ttyp;    /* pointer to tty structure        */
  67.     char    *ds_mp;        /* pointer to next available buf char    */
  68.     char    *ds_buf;    /* input buffer                */
  69.     u_long    ds_atimo;    /* Activity Timeout            */
  70.     u_long    ds_wtimo;    /* Wait State Timeout            */
  71.     long    ds_timer;    /* Timer - can't be unsigned        */
  72.     u_long    ds_cchr;    /* number of characters recieved    */
  73.     u_long    ds_cchs;    /* number of characters sent        */
  74.     u_long    ds_cpsip;    /* number of packets sent up to IP    */
  75.     u_long    ds_cprip;    /* number of packets recieved from IP    */
  76.     u_long    ds_ctpbusy;    /* # of times tty was active        */
  77.     u_long    ds_ctpidle;    /* # of times tty was idle        */
  78.     u_long    ds_sesc;    /* # of chars escaped in packets sent    */
  79.     u_long    ds_resc;    /* # of chars escaped in packets received */
  80.     short    ds_mtu;        /* mtu for this interface        */
  81. };
  82.  
  83.  
  84. /*
  85. ** DU interface state flags.
  86. */
  87. #define DS_ESCAPED    0x0001    /* saw a FRAME_ESCAPE            */
  88. #define DS_OACTIVE    0x0002    /* actively sending a packet        */
  89. #define DS_LWAITING    0x0010    /* waiting for a tty            */
  90. #define DS_LACTIVE    0x0020    /* have active line            */
  91. #define DS_LDOWN    0x0040    /* Line lost or no premission to call    */
  92. #define DS_FAILCALL    0x0080  /* Attempted call recently, but failed    */
  93. #define DS_MONITORON    0x0100  /* Monitoring activity            */
  94. #define DS_ENABLECALL    0x0200    /* This side can initiate a call    */
  95.